/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Juanan
 */
@Entity
@Table(name = "top_topology")
@NamedQueries(
{
    @NamedQuery(name = "TopTopology.findAll", query = "SELECT t FROM TopTopology t")
})
public class TopTopology implements Serializable
{
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "TOP_ID")
    private Integer topId;
    @Column(name = "TOP_CODE")
    private String topCode;
    @Column(name = "TOP_ORDER")
    private Long topOrder;
    @JoinColumn(name = "NOD_ID_GROUP", referencedColumnName = "NOD_ID")
    @ManyToOne(optional = false)
    private NodNode nodIdGroup;
    @JoinColumn(name = "NOD_ID1", referencedColumnName = "NOD_ID")
    @ManyToOne(optional = false)
    private NodNode nodId1;
    @JoinColumn(name = "NOD_ID2", referencedColumnName = "NOD_ID")
    @ManyToOne(optional = false)
    private NodNode nodId2;

    public TopTopology()
    {
    }

    public TopTopology(Integer topId)
    {
        this.topId = topId;
    }

    public Integer getTopId()
    {
        return topId;
    }

    public void setTopId(Integer topId)
    {
        this.topId = topId;
    }

    public String getTopCode()
    {
        return topCode;
    }

    public void setTopCode(String topCode)
    {
        this.topCode = topCode;
    }

    public Long getTopOrder()
    {
        return topOrder;
    }

    public void setTopOrder(Long topOrder)
    {
        this.topOrder = topOrder;
    }

    public NodNode getNodIdGroup()
    {
        return nodIdGroup;
    }

    public void setNodIdGroup(NodNode nodIdGroup)
    {
        this.nodIdGroup = nodIdGroup;
    }

    public NodNode getNodId1()
    {
        return nodId1;
    }

    public void setNodId1(NodNode nodId1)
    {
        this.nodId1 = nodId1;
    }

    public NodNode getNodId2()
    {
        return nodId2;
    }

    public void setNodId2(NodNode nodId2)
    {
        this.nodId2 = nodId2;
    }

    @Override
    public int hashCode()
    {
        int hash = 0;
        hash += (topId != null ? topId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object)
    {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TopTopology))
        {
            return false;
        }
        TopTopology other = (TopTopology) object;
        if ((this.topId == null && other.topId != null) || (this.topId != null && !this.topId.equals(other.topId)))
        {
            return false;
        }
        return true;
    }

    @Override
    public String toString()
    {
        return "entities.TopTopology[ topId=" + topId + " ]";
    }
    
}
